package extreme.tddscaffold;

public enum GoodsTypeEnum {

    GOODS{
        @Override
        public int getCurrentQuality(int sellIn, int quality) {
            if(sellIn > 0){
                quality = quality - 1;
            }else {
                quality = quality - 2;
            }
            return Math.max(quality, 0);
        }
    },
    AGED_BRIE{
        @Override
        public int getCurrentQuality(int sellIn, int quality) {
            return quality + 1;
        }
    },
    SULFURAS{
        @Override
        public int getCurrentQuality(int sellIn, int quality) {
            return quality;
        }
    },
    BACKSTAGE_PASS{
        @Override
        public int getCurrentQuality(int sellIn, int quality) {
            if(sellIn <= 5 && sellIn >= 0){
                return  quality + 3;
            }else if(sellIn <= 10 && sellIn >= 0){
                 return quality + 2;
            }else if(sellIn > 10){
                return quality + 1;
            }else {
                return 0;
            }
        }
    };

    public abstract int getCurrentQuality(int sellIn, int quality);

}
